package com.example.androidlearning.sy6;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.os.PersistableBundle;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;

import com.example.androidlearning.R;

public class Sy6Activity010 extends Activity {

    Button button;
    TextView textView;

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.sy0601_bundle_another);

        button = findViewById(R.id.sy0601an_btn);
        textView = findViewById(R.id.sy0601_text);

        //获取Bundle
        Intent intent = getIntent();
        savedInstanceState = intent.getExtras();
        textView.setText(savedInstanceState.getString("text"));

        button.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                startActivity(new Intent(Sy6Activity010.this, Sy6Activity01.class));
            }
        });

    }
}
